home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 424_02 / ED-157 / insq.c < prev    next >
C/C++ Source or Header  |  1993-09-10  |  2KB  |  59 lines

  1. /*
  2.  * Copyright (C) 1992 by Rush Record (rhr@clio.rice.edu)
  3.  * 
  4.  * This file is part of ED.
  5.  * 
  6.  * ED is free software; you can redistribute it and/or modify it under the terms
  7.  * of the GNU General Public License as published by the Free Software Foundation.
  8.  * 
  9.  * ED is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  10.  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  11.  * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  12.  * 
  13.  * You should have received a copy of the GNU General Public License along with ED
  14.  * (see the file COPYING).  If not, write to the Free Software Foundation, 675
  15.  * Mass Ave, Cambridge, MA 02139, USA.
  16.  */
  17. #include "opsys.h"
  18.  
  19. #include "rec.h"
  20.  
  21. /******************************************************************************\
  22. |Routine: insq
  23. |Callby: buffer_app carriage_ret copy_buffer do_grep include_file inquire insert load_buffer load_file openline rec_insert rec_merge rec_split rec_trim str_to_buf
  24. |Purpose: Inserts a record in a record queue.
  25. |Arguments:
  26. |    e is the record to insert.
  27. |    p is the new record's predecessor.
  28. \******************************************************************************/
  29. void insq(e,p)
  30. register rec_ptr e,p;
  31. {
  32.     register rec_ptr n;
  33.  
  34.     n = p->next;
  35.     e->next = n;
  36.     n->prev = e;
  37.     p->next = e;
  38.     e->prev = p;
  39. }
  40.  
  41. /******************************************************************************\
  42. |Routine: remq
  43. |Callby: buffer_empty inquire killer rec_insert rec_merge rec_trim toss_data
  44. |Purpose: Removes a record from a record queue.
  45. |Arguments:
  46. |    e is the record to remove.
  47. \******************************************************************************/
  48. void remq(e)
  49. register rec_ptr e;
  50. {
  51.     register rec_ptr a,b;
  52.  
  53.     a = e->prev;
  54.     b = e->next;
  55.     a->next = b;
  56.     b->prev = a;
  57. }
  58.  
  59.